import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/material.dart' hide Action;
import 'package:school_safe_teacher/message/entity/message_entity.dart';

enum MessageAction {
  action,
  onRefresh,
  onLoad,
  readAll,
  success,
  complete,
  refreshHomeNum,
}

class MessageActionCreator {
  static Action onAction() {
    return const Action(MessageAction.action);
  }

  static Action onRefreshHomeNum() {
    return const Action(MessageAction.refreshHomeNum);
  }

  static Action onRefresh() {
    return Action(MessageAction.onRefresh);
  }

  static Action onLoad(int page) {
    return Action(MessageAction.onLoad, payload: page);
  }

  static Action readAll() {
    return Action(MessageAction.readAll);
  }

  static Action onSuccess(List<MessageEntity> list) {
    return Action(MessageAction.success, payload: list);
  }

  static Action onComplete() {
    return Action(MessageAction.complete);
  }
}
